package com.woniu.car.service.impl;

import com.woniu.car.domain.TGoodDetail;
import com.woniu.car.mapper.TGoodDetailMapper;
import com.woniu.car.service.TGoodDetailService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.Data;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author chestnuts
 * @since 2021-06-21
 */
@Data
@Service
public class TGoodDetailServiceImpl extends ServiceImpl<TGoodDetailMapper, TGoodDetail> implements TGoodDetailService {


//    @Override
//    public void insertDetail(List<GoodsOrderDetailParam> orderDetailList){
//
//        for (GoodsOrderDetailParam orderDetailParam : orderDetailList) {
//
//            double total = 0;
//
//            TGoodDetail detail = new TGoodDetail();
//            BeanUtils.copyProperties(orderDetailParam,detail);
//
//            Double price = orderDetailParam.getPrice();
//            Integer number = orderDetailParam.getNumber();
//
//            if (null != orderDetailParam.getDiscountMoney()) {
//                total = price * number * orderDetailParam.getDiscountMoney();
//            } else {
//                total = price * number - orderDetailParam.getFullMoney();
//            }
//
//            //生成订单详情编号
//            String code = UUID.randomUUID().toString();
//            detail.setDetailNumber(code);
//
//            detail.setTotal(total);
//            this.save(detail);
//
//        }
//    }
}
